package com.nstar.model.orderexpress;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        @hibernate.class
 *         table="order_info"
 *     
*/
public class OrderInfo implements Serializable {

    /** identifier field */
    private String orderId;

    /** nullable persistent field */
    private String userName;

    /** nullable persistent field */
    private String userAddr;

    /** nullable persistent field */
    private String telephone;

    /** nullable persistent field */
    private Date orderDate;

    /** nullable persistent field */
    private Date modifiedDate;

    /** nullable persistent field */
    private Date completeDate;

    /** persistent field */
    private com.nstar.model.orderexpress.UserInfo userInfo;

    /** persistent field */
    private com.nstar.model.orderexpress.OrderState orderState;

    /** persistent field */
    private com.nstar.model.orderexpress.OrderType orderType;

    /** persistent field */
    private com.nstar.model.orderexpress.Area area;

    /** persistent field */
    private Set orderInfoExps;

    /** full constructor */
    public OrderInfo(String orderId, String userName, String userAddr, String telephone, Date orderDate, Date modifiedDate, Date completeDate, com.nstar.model.orderexpress.UserInfo userInfo, com.nstar.model.orderexpress.OrderState orderState, com.nstar.model.orderexpress.OrderType orderType, com.nstar.model.orderexpress.Area area, Set orderInfoExps) {
        this.orderId = orderId;
        this.userName = userName;
        this.userAddr = userAddr;
        this.telephone = telephone;
        this.orderDate = orderDate;
        this.modifiedDate = modifiedDate;
        this.completeDate = completeDate;
        this.userInfo = userInfo;
        this.orderState = orderState;
        this.orderType = orderType;
        this.area = area;
        this.orderInfoExps = orderInfoExps;
    }

    /** default constructor */
    public OrderInfo() {
    }

    /** minimal constructor */
    public OrderInfo(String orderId, com.nstar.model.orderexpress.UserInfo userInfo, com.nstar.model.orderexpress.OrderState orderState, com.nstar.model.orderexpress.OrderType orderType, com.nstar.model.orderexpress.Area area, Set orderInfoExps) {
        this.orderId = orderId;
        this.userInfo = userInfo;
        this.orderState = orderState;
        this.orderType = orderType;
        this.area = area;
        this.orderInfoExps = orderInfoExps;
    }

    /** 
     *            @hibernate.id
     *             generator-class="assigned"
     *             type="java.lang.String"
     *             column="ORDER_ID"
     *         
     */
    public String getOrderId() {
        return this.orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    /** 
     *            @hibernate.property
     *             column="USER_NAME"
     *             length="50"
     *         
     */
    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    /** 
     *            @hibernate.property
     *             column="USER_ADDR"
     *             length="100"
     *         
     */
    public String getUserAddr() {
        return this.userAddr;
    }

    public void setUserAddr(String userAddr) {
        this.userAddr = userAddr;
    }

    /** 
     *            @hibernate.property
     *             column="TELEPHONE"
     *             length="30"
     *         
     */
    public String getTelephone() {
        return this.telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    /** 
     *            @hibernate.property
     *             column="ORDER_DATE"
     *             length="19"
     *         
     */
    public Date getOrderDate() {
        return this.orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    /** 
     *            @hibernate.property
     *             column="MODIFIED_DATE"
     *             length="19"
     *         
     */
    public Date getModifiedDate() {
        return this.modifiedDate;
    }

    public void setModifiedDate(Date modifiedDate) {
        this.modifiedDate = modifiedDate;
    }

    /** 
     *            @hibernate.property
     *             column="COMPLETE_DATE"
     *             length="19"
     *         
     */
    public Date getCompleteDate() {
        return this.completeDate;
    }

    public void setCompleteDate(Date completeDate) {
        this.completeDate = completeDate;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="USER_ID"         
     *         
     */
    public com.nstar.model.orderexpress.UserInfo getUserInfo() {
        return this.userInfo;
    }

    public void setUserInfo(com.nstar.model.orderexpress.UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="ORDER_STATE_ID"         
     *         
     */
    public com.nstar.model.orderexpress.OrderState getOrderState() {
        return this.orderState;
    }

    public void setOrderState(com.nstar.model.orderexpress.OrderState orderState) {
        this.orderState = orderState;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="ORDER_TYPE_ID"         
     *         
     */
    public com.nstar.model.orderexpress.OrderType getOrderType() {
        return this.orderType;
    }

    public void setOrderType(com.nstar.model.orderexpress.OrderType orderType) {
        this.orderType = orderType;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="AREA_ID"         
     *         
     */
    public com.nstar.model.orderexpress.Area getArea() {
        return this.area;
    }

    public void setArea(com.nstar.model.orderexpress.Area area) {
        this.area = area;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="ORDER_ID"
     *            @hibernate.collection-one-to-many
     *             class="com.nstar.model.orderexpress.OrderInfoExp"
     *         
     */
    public Set getOrderInfoExps() {
        return this.orderInfoExps;
    }

    public void setOrderInfoExps(Set orderInfoExps) {
        this.orderInfoExps = orderInfoExps;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("orderId", getOrderId())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof OrderInfo) ) return false;
        OrderInfo castOther = (OrderInfo) other;
        return new EqualsBuilder()
            .append(this.getOrderId(), castOther.getOrderId())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getOrderId())
            .toHashCode();
    }

}
